package FP;

import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;

public class FunctionalInterface {
    public static void main(String args[]) {
        List<Integer> list = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
        System.out.println("list = " + list);
        Predicate<Integer> isEvenNumber = n -> n % 2 == 0;
        System.out.println("In list: ");
        list.forEach(n -> {
            if (isEvenNumber.test(n)) {
                System.out.println(n + " is even number");
            }
        });
    }
}
